package com.tristia.entity.util;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import com.tristia.dao.GenericDao;
import com.tristia.entity.Cd;

public class CdDataLoader {
	private List<Cd> cds = new ArrayList<Cd>();
//	private CdService cdService;
	@Resource
	GenericDao<Cd, Long> cdDao;
	
	public void loadData() {
		for (Cd cd : cds) {
//			cdService.save(cd);
			cdDao.save(cd);
		}
		cds.clear();
		cds = null;
	}

	public void setCds(List<Cd> cds) {
		this.cds = cds;
	}
/*	@Autowired
	public void setCdService(CdService cdService) {
		this.cdService = cdService;
	}*/
	
	public void init() {
		loadData();
	}
}
